<html>
	<head>
		<title>editoneparsedfaileddata.html</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">

		<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
		<link href="../../css/general1.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../../script/prototype.js"></script>
		<script type="text/javascript" src="/vchzms-hiaward/dwr/engine.js"> </script>
		<script type="text/javascript" src="/vchzms-hiaward/dwr/util.js"> </script>
		<script type="text/javascript"
			src="/vchzms-hiaward/dwr/interface/OperatePbcFileDwrAction.js"></script>
		<script type="text/javascript">
      var props;
      var pbcsid;
      function getParamFromUrl(){
        var localUrl=window.location.href;
        var pos=localUrl.indexOf('=');
        alert(pos);
        var param=localUrl.substring(pos+1);
        alert(param+"0000");
        return param;
      }
      var callBack=function(data){
        $('source').innerHTML=data.source;
        $('date').innerHTML=data.vchdate;
        $('session').innerHTML=data.vcsession;
        $('subno').innerHTML=data.subno;
        var subnoTemp=data.subno;
        OperatePbcFileDwrAction.getDictBySubno(subnoTemp,function(data){
          var list=data.properties;
          props=data.properties;
          var content="";
          var updateoptions="<table width='600' border='0' cellspacing='0' cellpadding='0'class='tablist1'><tr><th colspan='2'>修改栏</th></tr>"
          for(var i=0;i<list.length;i++){
            var temp=list[i];
            content+=(temp+'/   ');
            updateoptions+="<tr><th width='100'>"+temp+"</th><td><input type='text' id='"+temp+"'></td></tr>";
          }
          updateoptions+="<tr><td colspan='2'><button onclick='subForm()' class='btn1'>提交修改</button></td></tr></table>";
          $('props').innerHTML=content;
          $('update').innerHTML=updateoptions;
        });
      }
      function getOriginalPbcDataById(id){
       OperatePbcFileDwrAction.getPbcOriginalDataInfobyId(id,callBack);
      }
      function getProp(){
        var id=getParamFromUrl();
        pbcsid=id;
        getOriginalPbcDataById(id);
      }
      function subForm(){
        OperatePbcFileDwrAction.getPbcOriginalDataInfobyId(pbcsid,function(data){
        //alert(data.source);
        var originalPbcData=data;
        alert(originalPbcData.source);
        for(var i=0;i<props.length;i++){
        var propName=props[i];
        originalPbcData[propName]=$(propName).value;
        }
        originalPbcData.state=3;
        OperatePbcFileDwrAction.updateOriginalPbcData(originalPbcData,function(data){
            alert("ok");
          });
        });
      }
    </script>
	</head>
	<body>
		<div id="errorinfo" style="top: 10px; left: 100px; position: absolute">
			<table width='600' border='0' cellspacing='0' cellpadding='0'
				class='tablist1'>
				<tr>
					<th colspan="2">
						解析失败数据修正
					</th>
				</tr>
				<tr>
					<th width="100">
						原始数据
					</th>
					<td>
						<span id="source"></span>
					</td>
				</tr>
				<tr>
					<th>
						对应项
					</th>
					<td>
						<span id="props"></span>
					</td>
				</tr>
				<tr>
					<th>
						日期
					</th>
					<td>
						<span id="date"></span>
					</td>
				</tr>
				<tr>
					<th>
						场次
					</th>
					<td>
						<span id="session"></span>
					</td>
				</tr>
				<tr>
					<th>
						分行号
					</th>
					<td>
						<span id="subno"></span>
					</td>
				</tr>
			</table>
		</div>
		<div id="update" style="top: 120px; left: 100px; position: absolute">

		</div>
		<script type="text/javascript">
      getProp();
    </script>
	</body>
</html>
